<html>
<body>
<?php
if ($_POST['fname'] == 'quit') die('uh oh');
?>
<form action="#" method="post">
Name:: <input type="text" name="fname" />
Age: <input type="text" name="lname" />
<input type="submit" />

</form>
<?php
echo $_POST['fname'];
	if ($_POST['fname'] == '' || $_POST['lname'] == '')
	{
		echo "no  names found";
	}
	else
	{
		$con = mysql_connect('cocoagood16.ipowermysql.com','nicedb','nicedbpa55w0rd');
		if (!$con)
		{
			die('Could not connect: ' . mysql_error());
		}
		echo 'about to insert';
		mysql_select_db("niceairport", $con);
		$fname = $_POST["fname"];
		$lname = $_POST["lname"];
		$sql = "insert into test (test1,test2) values ('$fname', '$lname')";
echo '<br>' . $sql . '<br>';
		// Execute query
		mysql_query($sql,$con);

		mysql_close($con);
		echo 'inserted records';
	}
?>
</body>
</html>
